home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 011a / grtmd6a1.zip / INSTALL.SCR < prev    next >
Text File  |  1993-01-05  |  27KB  |  932 lines

  1. # $Header:   D:/GM6/S/SRC/DIST/GMINST/VCS/GM60U.SCV   1.4   05 Jan 1993 15:31:12   RDJ  $
  2. #
  3. # GM60U.SCR - installation script for GM version 6.0 Update (1993 MeSH)
  4. #
  5. # See the end of this file for floppy contents and maintenance history.
  6. #
  7.     #
  8.     # Setup
  9.     #
  10.     # &GMINST is set by the GMINST program to the drive and directory
  11.     # from which GMINST was loaded.  Derive just the drive from that
  12.     # for messages.
  13.     #
  14.     F_PARSE &GMINST -DRIVE GMINSTD
  15.     F_UNPARSE GMINSTD -DRIVE &GMINSTD
  16.     SETSTR GMPATH ""
  17.     #
  18.     # The INSTOPT DOS environment variable controls whether the
  19.     # installation is from floppies (normal) or from a network
  20.     # disk and to circumvent the free disk space check.  (See
  21.     # the block comment at the end of this file for details.)
  22.     #
  23.     GETENVSTR INSTOPT "INSTOPT" # "INSTOPT" must be in uppercase
  24.     #
  25.     # Set colors depending on display type.
  26.     #
  27.     SETSTR CINFO "WHITE"
  28.     SETSTR CPRMPT "WHITE"
  29.     SETSTR CERR "YELLOW"
  30.     SETSTR CDISK "BRWHITE"
  31.     MCW_GETVIDEO -ADAPTER A
  32.     MCW_GETVIDEO -MONITOR M
  33.     IFSTR &A == MDPA
  34.     DO
  35.     IFSTR &M == MONO
  36.     DO
  37.         SETSTR CINFO "WHITE"
  38.         SETSTR CPRMPT "BRWHITE"
  39.         SETSTR CERR "BRWHITE"
  40.     END
  41.     END
  42.     #
  43.     # If CTRL-C is pressed, abort the installation.
  44.     #
  45.     ONCOND CTRLC
  46.     GOTO ABORT_CTRLC
  47.     ONCOND CRITERR
  48.     GOTO ABORT_CRITERR
  49.     #
  50.     # Clear the screen.
  51.     #
  52.     MCW_WINDOW -ID SCREEN -R1 1 -R2 24 -C1 1 -C2 80 -FG WHITE -BG BLACK
  53.     MCW_MKTEXT
  54.     MCW_CONTROL CLEAR
  55.     #
  56.     # Welcome Screen
  57.     #
  58.     # The TITLE window persists throughout installation.
  59.     # Describe the installation and obtain the destination path, &GMPATH.
  60.     #
  61.     MCW_WINDOW -ID TITLE -NAME "" -FG &CINFO -R1 1 -R2 3 -C1 17 -C2 63
  62.     MCW_MKTEXTSTR " Installing Grateful Med Version 6.0 Update "
  63.     MCW_WINDOW -ID WHATAMI -NAME " ABOUT THIS UPDATE " -FG &CINFO -R1 5 -R2 14 -C 62
  64.     MCW_MKTEXT
  65.     MCW_PRINTF " This Update modifies Grateful Med 6.0 to reflect changes\n"
  66.     MCW_PRINTF " made to the NLM computer and to incorporate the 1993 MeSH.\n"
  67.     MCW_PRINTF " It is important to install this Update to maintain search\n"
  68.     MCW_PRINTF " effectiveness.  This Update is a supplement to Version 6.0\n"
  69.     MCW_PRINTF " and should be installed in the same subdirectory.\n\n"
  70.     MCW_PRINTF " For assistance or more information, contact the MEDLARS\n"
  71.     MCW_PRINTF " Service Desk at 1-800-638-8480."
  72.     MCW_WINDOW -ID INSDEST -NAME " INSTALLATION " -FG &CINFO -R1 16 -R2 24 -C 70
  73.     MCW_MKTEXT
  74.     MCW_PRINTF " This Update will be installed in the following directory:"
  75.     MCW_CONTROL POS 5 1
  76.     MCW_PRINTF " If this is incorrect, modify it to indicate the location of the\n"
  77.     MCW_PRINTF " Grateful Med 6.0 program.  Use the Backspace key to edit.\n"
  78.     MCW_PRINTF " Press Enter to contine or Esc to abort."
  79.     MCW_WINDOW -ID WHERE_P -NAME "" -R1 18 -R2 20 -C 36 -FG &CPRMPT -BG BLACK
  80.     MCW_MKTEXT
  81.     MCW_CONTROL CLEAR
  82.     MCW_PRINTF "C:\\GM6"        # default destination path
  83. GET_GMPATH:
  84.     MCW_CONTROL EDIT -EXITKEY KEY
  85.     IFSTR &KEY == "ESC"
  86.     DO
  87.     MCW_DROP -ID WHERE_P -DELETE
  88.     MCW_DROP -ID INSDEST -DELETE
  89.     MCW_DROP -ID WHATAMI -DELETE
  90.     GOTO ABORT
  91.     END
  92.     IFSTR &KEY != "ENTER"        # ignore all other keypresses
  93.     DO
  94.     ECHO "\x07" -NO_NEWLINE
  95.     GOTO GET_GMPATH
  96.     END
  97.     MCW_GET CONTENTS GMPATH
  98.     IFSTR &GMPATH == ""         # disallow blank; confuses normalization
  99.     DO
  100.     ECHO "\x07" -NO_NEWLINE
  101.     GOTO GET_GMPATH
  102.     END
  103.     #
  104.     # Normalize path. If just drive is specified, get current
  105.     # dir for that drive.  Ensure no trailing backslash.
  106.     #
  107.     SETSTR X &GMPATH            # normalize path
  108.     IFSTR &X !==| ":"            # not just drive
  109.     DO
  110.     IFSTR &X !==| "\\"        # no trailing backslash
  111.         SETSTRF X "%s\\" &X     # need it for parsing
  112.     END
  113.     F_PARSE &X -DRIVE D -dir DI
  114.     IFSTR &D != ""
  115.     SETSTRF D "%s:" &D        # look like a drive again
  116.     IFSTR &DI == ""
  117.     F_INFO CURRENT_DIR GMPATH -DRIVE &D
  118.     IFSTR &DI != ""
  119.     SETSTRF GMPATH "%s%s" &D &DI
  120.     #
  121.     # Ensure dir exists
  122.     #
  123.     IFSTR &GMPATH !==| "\\"        # e.g. not "c:\"
  124.     DO
  125.     F_INFO ATTR X &GMPATH
  126.     IFERR
  127.     DO
  128. GET_GMPATH_ERR:
  129.         SETSTRF MSG "%s is not a subdirectory.\nPlease reenter." &GMPATH
  130.         GOSUB SHOW_MSG
  131.         GOTO GET_GMPATH
  132.     END
  133.     IFSTR &X !~ "D"         # not reported for "c:\"
  134.         GOTO GET_GMPATH_ERR     # not a directory
  135.     END
  136.     SETSTRF XS "%s\SEARCH.EXE" &GMPATH
  137.     F_INFO ATTR X &XS            # SEARCH.EXE indicates GM installed
  138.     IFERR
  139.     DO
  140.     SETSTRF MSG "%s not found,\nso Grateful Med 6.0 is not present in that subdirectory." &XS
  141.     GOSUB SHOW_MSG
  142.     GOTO GET_GMPATH
  143.     END
  144.     SETSTR XS ""
  145.     MCW_DROP -ID WHERE_P -DELETE
  146.     MCW_DROP -ID INSDEST -DELETE
  147.     MCW_DROP -ID WHATAMI -DELETE
  148.     #
  149.     # If either TREE.DCT or TREE.IND are missing, installation
  150.     # of the tree files is optional.
  151.     #
  152.     SETSTRF X "%s\\%s" &GMPATH TREE.DCT
  153.     F_INFO SIZE X &X
  154.     IFERR
  155.     GOTO NO_TREE
  156.     SETSTRF X "%s\\%s" &GMPATH TREE.IND
  157.     F_INFO SIZE X &X
  158.     IFERR
  159.     GOTO NO_TREE
  160.     SETSTR MESHTREE "Y"     # assume want to install Expanded MeSH
  161.     SETSTR TREEIND "Y"        # assume Expanded MeSH exists in installed GM
  162.     GOTO HAVE_TREE
  163.     #
  164.     # Select option of installing tree files or not.
  165.     #
  166. NO_TREE:
  167.     SETSTR TREEIND "N"
  168.     MCW_WINDOW -ID TREEXP -NAME " EXPANDED MeSH " -FG &CINFO -R1 5 -R2 14 -C 60
  169.     MCW_MKTEXT
  170.     MCW_PRINTF " The Expanded MeSH feature was not installed in sub-\n"
  171.     MCW_PRINTF " directory %s\n\n" &GMPATH
  172.     MCW_PRINTF " This feature requires 360K of hard disk space and will\n"
  173.     MCW_PRINTF " show the more specific terms included under a MeSH term.\n"
  174.     MCW_PRINTF " If you want to install the Expanded MeSH now, answer YES\n"
  175.     MCW_PRINTF " to the question below.  If you do not want to install\n"
  176.     MCW_PRINTF " this feature, answer NO."
  177.     MCW_WINDOW -ID INSTREE -NAME " OPTION " -FG &CPRMPT -BG BLACK -R1 16 -R2 25 -C 60
  178.     MCW_MENU CLEAR
  179.     MCW_MENU DEFINE -PRE " Do you want to install the Expanded MeSH feature?\n\n"
  180.     SETSTR X "\n Use the up or down arrow keys to highlight your choice\n and press Enter to continue or Esc to abort."
  181.     MCW_MENU DEFINE -POST &X
  182.     MCW_MENU DEFINE -ITEM "Y" "Yes"
  183.     MCW_MENU DEFINE -ITEM "N" "No"
  184.     SETSTR MESHTREE "Y"     # default selection is highlighted first
  185. NTREE_SEL:
  186.     MCW_MENU SELECT -VALUE MESHTREE -EXITKEY KEY
  187.     MCW_DROP -ID TREEXP -DELETE
  188.     MCW_DROP -ID INSTREE -DELETE
  189.     IFSTR &KEY == "ESC"
  190.     GOTO ABORT
  191.     IFSTR &KEY != "ENTER"
  192.     GOTO NTREE_SEL
  193. HAVE_TREE:
  194.     IFSTR &INSTOPT ~~ "NOS"    # "NOSpacecheck" installation option
  195.     GOTO SPACE_DONE
  196.     #
  197.     # Ensure sufficient free space exists on the target disk.
  198.     # Disk space requirements were calculated by adding the
  199.     # byte counts of all the files, adding 8KB for each file
  200.     # (10 for full, 8 for no-tree installation), then adding
  201.     # 16KB as fudge.
  202.     #
  203.     SETSTR SPACEREQ "1331078"
  204.     IFSTR &MESHTREE == "N"
  205.     SETSTR SPACEREQ "949078"
  206.     F_INFO FREESPACE X -DRIVE &GMPATH
  207.     IFNUM &X < &SPACEREQ
  208.     DO
  209.     MCW_WINDOW -ID MSG -NAME "" -FG &CERR -R1 5 -R2 10 -C 65
  210.     MCW_MKTEXT
  211.     MCW_PRINTF " There is insufficient disk space to complete the installation\n"
  212.     MCW_PRINTF " in %s\n" &GMPATH
  213.     MCW_PRINTF " %s bytes are required, but only %s are available.\n" &SPACEREQ &X
  214.     MCW_PRINTF " (Press Enter to continue.)"
  215. SPACE_GETCH:
  216.     KBD_GETCH -VALUE KEY
  217.     IFSTR &KEY != "ENTER"
  218.         GOTO SPACE_GETCH
  219.     MCW_DROP -ID MSG -DELETE
  220.     GOTO ABORT
  221.     END
  222. SPACE_DONE:
  223.     #
  224.     # Summarize what will be done during the installation.
  225.     #
  226.     SETSTR X "N"
  227.     IFSTR &TREEIND == "N"
  228.     DO
  229.     IFSTR &MESHTREE == "Y"
  230.         SETSTR X "Y"
  231.     IFSTR &MESHTREE == "N"
  232.         SETSTR X "X"
  233.     END
  234.     IFSTR &X == "N"
  235.     MCW_WINDOW -ID SUMMARY -NAME " SUMMARY " -FG &CINFO -R1 5 -R2 10 -C 72
  236.     IFSTR &X != "N"
  237.     MCW_WINDOW -ID SUMMARY -NAME " SUMMARY " -FG &CINFO -R1 5 -R2 11 -C 72
  238.     MCW_MKTEXT
  239.     MCW_PRINTF " Version 6.0 Update will be installed in subdirectory\n    %s\n" &GMPATH
  240.     IFSTR &X == "Y"
  241.         MCW_PRINTF " The Expanded MeSH feature will be included.\n"
  242.     IFSTR &X == "X"
  243.         MCW_PRINTF " The Expanded MeSH feature will not be included.\n"
  244.     MCW_PRINTF "\n Press Enter to begin or Esc to abort."
  245. WAITINST:
  246.     KBD_GETCH -VALUE KEY
  247.     IFSTR &KEY == "ESC"
  248.     DO
  249.     MCW_DROP -ID SUMMARY -DELETE
  250.     GOTO ABORT
  251.     END
  252.     IFSTR &KEY == "ENTER"
  253.     DO
  254.     MCW_DROP -ID SUMMARY -DELETE
  255.     GOTO BEGINST
  256.     END
  257.     GOTO WAITINST
  258.     #
  259.     # Begin installation.
  260.     #
  261. BEGINST:
  262.     #
  263.     # If TREE.DCT exists, this is a 3.5" disk set.
  264.     # Set &INST to 3 for 3.5" or 5 for 5.25".
  265.     #
  266.     SETSTRF INST "3"
  267.     SETSTRF X "%s%s" &GMINST TREE.DCT
  268.     F_INFO ATTR X &X
  269.     IFERR
  270.     SETSTRF INST "5"
  271.     #
  272.     # Display progress in a window.
  273.     #
  274.     MCW_WINDOW -ID STAT -NAME " INSTALLATION " -R1 5 -R2 18 -C 78
  275.     MCW_MKTEXT
  276.     MCW_CONTROL POS 13 1
  277.     #
  278.     # Copy all files from floppies to temporary files on disk.
  279.     #
  280.     # (&NVOL is used in a CHECKVOL prompt.)
  281.     #
  282.     SETSTR NVOL ""
  283.     SETSTR VOL "1 OF 2"
  284.     IFSTR &INST == "5"
  285.     SETSTR VOL "1 OF 4"
  286.     GOSUB CHECKVOL
  287.     SETSTRF INFILE "%s%s" &GMINST DBS
  288.     SETSTRF OUTFILE "%s\\%s" &GMPATH DBS.NEW
  289.     GOSUB FCOPY
  290.     IFERR
  291.     GOTO INST_ERR
  292.     SETSTRF INFILE "%s%s" &GMINST REVIEW.LST
  293.     SETSTRF OUTFILE "%s\\%s" &GMPATH REVIEW.NEW
  294.     GOSUB FCOPY
  295.     IFERR
  296.     GOTO INST_ERR
  297.     SETSTRF INFILE "%s%s" &GMINST GMTERMS.SYN
  298.     SETSTRF OUTFILE "%s\\%s" &GMPATH GMTERMS.NEW
  299.     GOSUB FCOPY
  300.     IFERR
  301.     GOTO INST_ERR
  302.     SETSTRF INFILE "%s%s" &GMINST JOURNAL.LST
  303.     SETSTRF OUTFILE "%s\\%s" &GMPATH JOURNAL.NEW
  304.     GOSUB FCOPY
  305.     IFERR
  306.     GOTO INST_ERR
  307.     SETSTRF INFILE "%s%s" &GMINST WHATAMI.BAT
  308.     SETSTRF OUTFILE "%s\\%s" &GMPATH WHATAMIB.NEW
  309.     GOSUB FCOPY
  310.     IFERR
  311.     GOTO INST_ERR
  312.     SETSTRF INFILE "%s%s" &GMINST WHATAMI.U01
  313.     SETSTRF OUTFILE "%s\\%s" &GMPATH WHATAMI1.NEW
  314.     GOSUB FCOPY
  315.     IFERR
  316.     GOTO INST_ERR
  317.     SETSTRF INFILE "%s%s" &GMINST MESHN.IND
  318.     SETSTRF OUTFILE "%s\\%s" &GMPATH MESHNI.NEW
  319.     GOSUB FCOPY
  320.     IFERR
  321.     GOTO INST_ERR
  322.     IFSTR &MESHTREE == "N"
  323.     DO
  324.     IFSTR &TREEIND == "N"
  325.     DO
  326.         MCW_CONTROL SCROLL +2
  327.         MCW_PRINTF "\rNot installing Expanded MeSH feature."
  328.     END
  329.     END
  330.     IFSTR &MESHTREE == "Y"
  331.     DO
  332.     IFSTR &TREEIND == "N"
  333.     DO
  334.         MCW_CONTROL SCROLL +2
  335.         MCW_PRINTF "\rInstalling Expanded MeSH feature."
  336.     END
  337.     SETSTRF INFILE "%s%s" &GMINST TREE.IND
  338.     SETSTRF OUTFILE "%s\\%s" &GMPATH TREEI.NEW
  339.     GOSUB FCOPY
  340.     IFERR
  341.         GOTO INST_ERR
  342.     END
  343.     IFSTR &INST == "5"
  344.     GOTO INST_5
  345.     #
  346.     # 3.5" disk
  347.     #
  348.     # TREE.DCT on #1, MESHN.DC1 on #1, MESHN.DC2 on #2.
  349.     #
  350.     IFSTR &MESHTREE == "Y"
  351.     DO
  352.     SETSTRF INFILE "%s%s" &GMINST TREE.DCT
  353.     SETSTRF OUTFILE "%s\\%s" &GMPATH TREED.NEW
  354.     GOSUB FCOPY
  355.     IFERR
  356.         GOTO INST_ERR
  357.     END
  358.     SETSTRF OUTFILE "%s\\%s" &GMPATH MESHND.NEW
  359.     GOSUB FOPEN_O
  360.     IFERR
  361.     GOTO INST_ERR
  362.     SETSTRF INFILE "%s%s" &GMINST MESHN.DC1
  363.     GOSUB FCOPY_O_OPENED
  364.     IFERR
  365.     GOTO INST_ERR
  366.     SETSTR VOL "2 OF 2"
  367.     GOSUB CHECKVOL
  368.     SETSTRF INFILE "%s%s" &GMINST MESHN.DC2
  369.     GOSUB FCOPY_O_OPENED
  370.     IFERR
  371.     GOTO INST_ERR
  372.     GOSUB FCLOSE_O
  373.     IFERR
  374.     GOTO INST_ERR
  375.     GOTO INST_ALLCOPY
  376.     #
  377.     # 5.25" disk
  378.     #
  379.     # TREE.DC1 on #2, TREE.DC2 on #1, MESHN.DC1 on #1,
  380.     # MESHN.DC2 on #3, MESHN.DC3 on #4.
  381.     #
  382. INST_5:
  383.     SETSTRF OUTFILE "%s\\%s" &GMPATH MESHND.NEW
  384.     SETSTRF INFILE "%s%s" &GMINST MESHN.DC1
  385.     GOSUB FCOPY
  386.     IFERR
  387.     GOTO INST_ERR
  388.     IFSTR &MESHTREE == "Y"
  389.     DO
  390.     SETSTRF OUTFILE "%s\\%s" &GMPATH TREED.NEW
  391.     GOSUB FOPEN_O
  392.     IFERR
  393.         GOTO INST_ERR
  394.     SETSTRF INFILE "%s%s" &GMINST TREE.DC1
  395.     GOSUB FCOPY_O_OPENED
  396.     IFERR
  397.         GOTO INST_ERR
  398.     SETSTR VOL "2 OF 4"
  399.     GOSUB CHECKVOL
  400.     SETSTRF INFILE "%s%s" &GMINST TREE.DC2
  401.     GOSUB FCOPY_O_OPENED
  402.     IFERR
  403.         GOTO INST_ERR
  404.     GOSUB FCLOSE_O
  405.     IFERR
  406.         GOTO INST_ERR
  407.     END
  408.     SETSTRF OUTFILE "%s\\%s" &GMPATH MESHND.NEW
  409.     GOSUB FOPEN_OA
  410.     IFERR
  411.     GOTO INST_ERR
  412.     IFSTR &MESHTREE != "Y"
  413.     SETSTR NVOL "2 OF 4"    # for CHECKVOL "volume not needed" prompt
  414.     SETSTR VOL "3 OF 4"
  415.     GOSUB CHECKVOL
  416.     IFSTR &MESHTREE != "Y"
  417.     SETSTR NVOL ""
  418.     SETSTRF INFILE "%s%s" &GMINST MESHN.DC2
  419.     GOSUB FCOPY_O_OPENED
  420.     IFERR
  421.     GOTO INST_ERR
  422.     SETSTR VOL "4 OF 4"
  423.     GOSUB CHECKVOL
  424.     SETSTRF INFILE "%s%s" &GMINST MESHN.DC3
  425.     GOSUB FCOPY_O_OPENED
  426.     IFERR
  427.     GOTO INST_ERR
  428.     GOSUB FCLOSE_O
  429.     IFERR
  430.     GOTO INST_ERR
  431.     GOTO INST_ALLCOPY
  432. INST_ALLCOPY:
  433.     #
  434.     # All floppies have been copied to temporary files.
  435.     # Delete old files and rename temporary files.
  436.     #
  437.     MCW_CONTROL SCROLL +1
  438.     SETSTR INFILE DBS.NEW
  439.     SETSTR OUTFILE DBS
  440.     GOSUB FREPLACE
  441.     IFERR
  442.     GOTO INST_ERR
  443.     SETSTR INFILE REVIEW.NEW
  444.     SETSTR OUTFILE REVIEW.LST
  445.     GOSUB FREPLACE
  446.     IFERR
  447.     GOTO INST_ERR
  448.     SETSTR INFILE GMTERMS.NEW
  449.     SETSTR OUTFILE GMTERMS.SYN
  450.     GOSUB FREPLACE
  451.     IFERR
  452.     GOTO INST_ERR
  453.     SETSTR INFILE JOURNAL.NEW
  454.     SETSTR OUTFILE JOURNAL.LST
  455.     GOSUB FREPLACE
  456.     IFERR
  457.     GOTO INST_ERR
  458.     SETSTR INFILE WHATAMIB.NEW
  459.     SETSTR OUTFILE WHATAMI.BAT
  460.     GOSUB FREPLACE
  461.     IFERR
  462.     GOTO INST_ERR
  463.     SETSTR INFILE WHATAMI1.NEW
  464.     SETSTR OUTFILE WHATAMI.U01
  465.     GOSUB FREPLACE
  466.     IFERR
  467.     GOTO INST_ERR
  468.     IFSTR &MESHTREE == "Y"
  469.     DO
  470.     SETSTR INFILE TREEI.NEW
  471.     SETSTR OUTFILE TREE.IND
  472.     GOSUB FREPLACE
  473.     IFERR
  474.         GOTO INST_ERR
  475.     SETSTR INFILE TREED.NEW
  476.     SETSTR OUTFILE TREE.DCT
  477.     GOSUB FREPLACE
  478.     IFERR
  479.         GOTO INST_ERR
  480.     END
  481.     SETSTR INFILE MESHNI.NEW
  482.     SETSTR OUTFILE MESHN.IND
  483.     GOSUB FREPLACE
  484.     IFERR
  485.     GOTO INST_ERR
  486.     SETSTR INFILE MESHND.NEW
  487.     SETSTR OUTFILE MESHN.DCT
  488.     GOSUB FREPLACE
  489.     IFERR
  490.     GOTO INST_ERR
  491.     # MCW_CONTROL SCROLL +2
  492.     # MCW_PRINTF "\rInstallation complete.  Press Enter to exit."
  493.     MCW_WINDOW -ID DONE -NAME "" -FG &CDISK -R1 20 -R2 23 -C 28
  494.     MCW_MKTEXT
  495.     MCW_PRINTF "  Installation complete.\n"
  496.     MCW_PRINTF "   Press Enter to exit."
  497. ALLCOPY_GETENT:
  498.     KBD_GETCH -VALUE KEY
  499.     IFSTR &KEY != "ENTER"
  500.     GOTO ALLCOPY_GETENT
  501.     MCW_DROP -ID DONE -DELETE
  502.     MCW_DROP -ID STAT -DELETE
  503.     MCW_DROP -ID TITLE -DELETE
  504.     # No sense in doing this because we can't say "Enter SEARCH to begin."
  505.     # F_SET_CURRENT -DRIVE &GMPATH -DIR &GMPATH
  506.     # IFERR            # not much we can do about it
  507.     #     GOTO INST_DONE
  508.     MCW_DROP -ID SCREEN -DELETE
  509.     EXIT 0
  510.     #
  511.     # Subroutines.
  512.     #
  513. ABORT_CTRLC:        # When CTRL-C is pressed.
  514.     ONCOND CTRLC -REVERT
  515.     GOTO ABORT
  516. ABORT_CRITERR:
  517.     ONCOND CRITERR -REVERT
  518.     MCW_WINDOW -ID CRIT -NAME " FATAL ERROR " -FG &CERR -R1 12 -R2 15 -C 60
  519.     MCW_MKTEXT
  520.     MCW_PRINTF " Critical error: %s" &OCE
  521.     IFSTR &OCD != ""
  522.     MCW_PRINTF " on drive %s" &OCD
  523.     MCW_PRINTF ".\n (Press the Esc key.)"
  524. CRIT_GETESC:
  525.     KBD_GETCH -VALUE KEY
  526.     IFSTR &KEY != "ESC"
  527.     GOTO CRIT_GETESC
  528.     MCW_DROP -ID CRIT -DELETE
  529.     GOTO ABORT
  530. ABORT:            # Come here to abort installation.
  531.     MCW_WINDOW -ID ABORT -NAME " NOTE " -FG &CINFO -R1 12 -R2 15 -C 28
  532.     MCW_MKTEXT
  533.     MCW_CONTROL FG &CERR
  534.     MCW_PRINTF "  Installation aborted.\n"
  535.     MCW_CONTROL FG &CINFO
  536.     MCW_PRINTF "   Press the Esc key."
  537.     IFSTR &GMPATH != ""
  538.     DO                    # attempt to delete scratch files
  539.     SETSTR OUTFILE "DBS.NEW"
  540.     GOSUB COND_DEL_O
  541.     SETSTR OUTFILE "REVIEW.NEW"
  542.     GOSUB COND_DEL_O
  543.     SETSTR OUTFILE "GMTERMS.NEW"
  544.     GOSUB COND_DEL_O
  545.     SETSTR OUTFILE "JOURNAL.NEW"
  546.     GOSUB COND_DEL_O
  547.     SETSTR OUTFILE "WHATAMIB.NEW"
  548.     GOSUB COND_DEL_O
  549.     SETSTR OUTFILE "WHATAMI1.NEW"
  550.     GOSUB COND_DEL_O
  551.     SETSTR OUTFILE "TREEI.NEW"
  552.     GOSUB COND_DEL_O
  553.     SETSTR OUTFILE "TREED.NEW"
  554.     GOSUB COND_DEL_O
  555.     SETSTR OUTFILE "MESHNI.NEW"
  556.     GOSUB COND_DEL_O
  557.     SETSTR OUTFILE "MESHND.NEW"
  558.     GOSUB COND_DEL_O
  559.     END
  560. ABORT_GETESC:
  561.     KBD_GETCH -VALUE KEY
  562.     IFSTR &KEY != "ESC"
  563.     GOTO ABORT_GETESC
  564.     MCW_DROP -ID ABORT -DELETE
  565.     MCW_DROP -ID SCREEN -DELETE
  566.     EXIT 1
  567. INST_ERR:        # Display fatal error msg and abort installation.
  568.     MCW_CONTROL SCROLL +1
  569.     MCW_PRINTF "\r%s" &EMSG
  570.     SETSTR MSG &EMSG
  571.     GOSUB SHOW_MSG
  572.     GOTO ABORT
  573. SHOW_MSG:        # Show informational message in a window.
  574.     # SETSTRF X "%s\n(Press Enter to continue or Esc to abort.)" &MSG
  575.     # MCW_WINDOW -ID MSG -NAME "" -FG &CERR -R1 21 -R2 21 -C 60
  576.     # MCW_MKTEXTSTR &X
  577.     MCW_WINDOW -ID MSG -NAME "" -FG &CERR -R1 21 -R2 25 -C 76
  578.     MCW_MKTEXT
  579.     MCW_PRINTF "%s\n" &MSG
  580.     MCW_PRINTF "(Press Enter to continue or Esc to abort.)"
  581. SHOW_GETCH:
  582.     KBD_GETCH -VALUE KEY
  583.     IFSTR &KEY == "ESC"
  584.     DO
  585.     MCW_DROP -ID MSG -DELETE
  586.     GOTO ABORT
  587.     END
  588.     IFSTR &KEY != "ENTER"
  589.     GOTO SHOW_GETCH
  590.     MCW_DROP -ID MSG -DELETE
  591.     RETURN
  592. CHECKVOL:        # Ensure that disk with label &VOL is in the drive.
  593.     IFSTR &INSTOPT ~~ "NOF"    # "NOFloppy" installation option
  594.     RETURN        # not a floppy installation - all files in one dir
  595.     F_INFO LABEL X -DRIVE &GMINSTD
  596.     IFERR
  597.     DO
  598.     SETSTRF EMSG "\nI/O error reading drive %s." &GMINSTD
  599.     GOTO INST_ERR
  600.     END
  601.     IFSTR &VOL != &X
  602.     DO
  603.     ECHO "\x07" -NO_NEWLINE
  604.     SETSTR MSG ""
  605.     IFSTR &NVOL != ""
  606.         SETSTRF MSG ' Disk "%s" is not required.\n' &NVOL
  607.     SETSTRF MSG '%s Remove Disk "%s" and insert Disk "%s" in drive %s ' &MSG &X &VOL &GMINSTD
  608. #    GOSUB SHOW_MSG
  609.     SETSTRF MSG "%s\n (Press Enter to continue or Esc to abort.)" &MSG
  610.     MCW_WINDOW -ID MSG -NAME "" -FG &CDISK -R1 20 -R2 20 -C1 10 -C2 71
  611.     MCW_MKTEXTSTR &MSG
  612. CHECKV_GETCH:
  613.     KBD_GETCH -VALUE KEY
  614.     IFSTR &KEY == "ESC"
  615.     DO
  616.         MCW_DROP -ID MSG -DELETE
  617.         GOTO ABORT
  618.     END
  619.     IFSTR &KEY != "ENTER"
  620.         GOTO CHECKV_GETCH
  621.     MCW_DROP -ID MSG -DELETE
  622.     GOTO CHECKVOL
  623.     END
  624.     RETURN
  625. FOPEN_OA:        # Open &OUTFILE for appending.
  626.     MCW_CONTROL SCROLL +2
  627.     MCW_PRINTF "\rResuming  file %s" &OUTFILE
  628.     F_OPEN -ID OUTFILE &OUTFILE -MODE "ab"
  629.     IFERR
  630.     SETSTRF EMSG "Error opening %s for appending." &OUTFILE
  631.     RETURN
  632. FOPEN_O:        # Open &OUTFILE.
  633.     MCW_CONTROL SCROLL +2
  634.     MCW_PRINTF "\rCreating  file %s" &OUTFILE
  635.     F_OPEN -ID OUTFILE &OUTFILE -MODE "wb"
  636.     IFERR
  637.     SETSTRF EMSG "Error opening %s for writing." &OUTFILE
  638.     RETURN
  639. FCLOSE_O:        # Close &OUTFILE and set modification time.
  640.     MCW_CONTROL SCROLL +1
  641.     MCW_PRINTF "\rCompleted file %s" &OUTFILE
  642.     F_CLOSE -ID OUTFILE
  643.     IFERR
  644.     DO
  645.     SETSTRF EMSG "Error closing output file %s." &OUTFILE
  646.     RETURN
  647.     END
  648.     F_SET_FILE &OUTFILE -MTIME &INMTIME
  649.     RETURN
  650. FOPEN_I:        # Open &INFILE and get modification time
  651.     MCW_CONTROL SCROLL +1
  652.     MCW_PRINTF "\rCopying   file %s" &INFILE
  653.     F_INFO MTIME_NUM INMTIME &INFILE
  654.     IFERR
  655.     DO
  656.     SETSTRF EMSG "Unable to locate %s" &INFILE
  657.     RETURN
  658.     END
  659.     F_OPEN -ID INFILE &INFILE -MODE "rb"
  660.     IFERR
  661.     SETSTRF EMSG "Error opening %s for reading." &INFILE
  662.     RETURN
  663. FCLOSE_I:        # Close &INFILE.
  664.     F_CLOSE -ID INFILE
  665.     IFERR
  666.     SETSTRF EMSG "Error closing input file %s" &INFILE
  667.     RETURN
  668. FCOPY:            # Copy &INFILE to &OUTFILE.
  669.     GOSUB FOPEN_O
  670.     IFERR
  671.     RETURN
  672.     GOSUB FOPEN_I
  673.     IFERR
  674.     RETURN
  675.     GOSUB FCOPY_IO_OPENED
  676.     IFERR
  677.     RETURN
  678.     GOSUB FCLOSE_I
  679.     IFERR
  680.     RETURN
  681.     GOSUB FCLOSE_O
  682.     IFERR
  683.     RETURN
  684.     RETURN
  685. FCOPY_O_OPENED:     # Open &INFILE and copy to opened output file.
  686.     GOSUB FOPEN_I
  687.     IFERR
  688.     RETURN
  689.     GOSUB FCOPY_IO_OPENED
  690.     IFERR
  691.     RETURN
  692.     GOSUB FCLOSE_I
  693.     IFERR
  694.     RETURN
  695.     RETURN
  696. FCOPY_IO_OPENED:    # Copy opened input file to opened output file.
  697.     F_INFO SIZE INSIZE &INFILE
  698.     F_CALC BLOCKSIZE BLK -SIZE &INSIZE -BLOCKS 50
  699.     IFSTR &BLK == "0"        # F_COPY -BYTES 0 -> copy whole file
  700.     GOTO COPY_NEXTBLK
  701.     # Display a percentage-complete bar if the file isn't tiny.
  702.     MCW_WINDOW -ID BART -FG &CINFO -R1 20 -R2 24 -C 54
  703.     MCW_MKTEXT
  704.     MCW_CONTROL POS 1 1
  705.     MCW_PRINTF "Press Esc to abort installation."
  706.     MCW_CONTROL POS 5 3
  707.     MCW_PRINTF "%s" "0%        25%          50%          75%        100%"
  708.     MCW_WINDOW -ID BAR -NAME " FILE COPY PROGRESS " -FG &CINFO -R1 21 -R2 23 -C 54
  709.     MCW_MKTEXT
  710.     MCW_CONTROL POS 1 2
  711. COPY_NEXTBLK:
  712.     KBD_HIT        # key pressed?
  713.     IFERR
  714.     DO
  715.     KBD_GETCH -VALUE KEY
  716.     IFSTR &KEY == "ESC"
  717.     DO
  718.         GOTO ABORT
  719.     END
  720.     END
  721.     IFSTR &BLK != "0"
  722.     MCW_PRINTF "\xb1"
  723.     F_COPY -IN INFILE -OUT OUTFILE -BYTES &BLK -VERIFY
  724.     IFERR 1
  725.     GOTO COPY_NEXTBLK
  726.     IFERR 100
  727.     SETSTRF EMSG "Error while reading %s" &INFILE
  728.     IFERR 200
  729.     SETSTRF EMSG "Error while writing %s" &OUTFILE
  730.     MCW_DROP -ID BAR -DELETE
  731.     MCW_DROP -ID BART -DELETE
  732.     MCW_WINDOW -ID STAT
  733.     RETURN
  734. FREPLACE:        # Delete &OUTFILE and rename &INFILE to &OUTFILE.
  735.     SETSTRF XI "%s\\%s" &GMPATH &INFILE
  736.     SETSTRF XO "%s\\%s" &GMPATH &OUTFILE
  737.     MCW_CONTROL SCROLL +1
  738.     MCW_PRINTF "\r"
  739.     F_INFO MTIME_NUM X &XO
  740.     IFERR 101        # F_ERRNO_NOTFOUND
  741.     GOTO FREPL_REN
  742.     MCW_PRINTF "Deleting file %-12s  " &OUTFILE
  743.     F_DELETE &XO
  744.     IFERR
  745.     DO
  746.     SETSTRF EMSG "Error deleting file %s" &OUTFILE
  747.     RETURN
  748.     END
  749. FREPL_REN:
  750.     MCW_PRINTF "Renaming file %s to %s" &INFILE &OUTFILE
  751.     F_MOVE &XI &XO
  752.     IFERR
  753.     DO
  754.     SETSTRF EMSG "Error renaming file %s to %s" &INFILE &OUTFILE
  755.     RETURN
  756.     END
  757.     RETURN
  758. COND_DEL_O:        # delete &OUTFILE if it exists
  759.     SETSTRF XI "%s\\%s" &GMPATH &OUTFILE
  760.     F_INFO MTIME_NUM INMTIME &XI
  761.     IFERR 101        # F_ERRNO_NOTFOUND
  762.     RETURN
  763.     F_DELETE &XI
  764.     SETERR 0                # ignore error
  765.     RETURN
  766.     #
  767.     # No lines are read by the script interpreter past the EOF statement.
  768.     #
  769.     EOF
  770. #
  771. # To prepare distribution floppy sets for Grateful Med 6.1A, organize
  772. # the floppies as follows (be certain the floppies are labelled
  773. # properly with the DOS "LABEL" command):
  774. #
  775. #    5.25" (360K) floppies           3.5" (720K) floppies
  776. #    ---------------------        --------------------
  777. #    LABEL: 1 OF 4            LABEL: 1 OF 2
  778. #        INSTALL.EXE             INSTALL.EXE
  779. #        INSTALL.SCR             INSTALL.SCR
  780. #        DBS                 DBS
  781. #        GMTERMS.SYN             GMTERMS.SYN
  782. #        JOURNAL.LST             JOURNAL.LST
  783. #        REVIEW.LST                REVIEW.LST
  784. #        WHATAMI.BAT             WHATAMI.BAT
  785. #        WHATAMI.U01             WHATAMI.U01
  786. #        TREE.IND                TREE.IND
  787. #        MESHN.IND                MESHN.IND
  788. #        TREE.DC1                TREE.DCT
  789. #        MESHN.DC1                MESHN.DC1
  790. #    LABEL: 2 OF 4            LABEL: 2 OF 2
  791. #        TREE.DC2                MESHN.DC2
  792. #    LABEL: 3 OF 4
  793. #        MESHN.DC2
  794. #    LABEL: 4 OF 4
  795. #        MESHN.DC3
  796. #
  797. # Note that GMINST.EXE should be copied to the #1 floppies as
  798. # INSTALL.EXE, and GM60U.SCR should be copied as INSTALL.SCR.
  799. #
  800. # To install, place disk #1 into a drive (e.g., A:) and run
  801. # the INSTALL program:
  802. #
  803. #    A:INSTALL
  804. #
  805. # To allow users to install when all the files are located in
  806. # a single directory (e.g., from a LAN instead of from floppies),
  807. # copy all of the files from one or the other disk set (3.5"
  808. # or 5.25") and issue the following commands:
  809. #
  810. #    SET INSTOPT=NOF
  811. #    [drive:][path]INSTALL
  812. #    SET INSTOPT=
  813. #
  814. # For either way of installing, the check for free disk space
  815. # may be circumvented by defining "INSTOPT" to contain "NOS", e.g.
  816. #
  817. #    SET INSTOPT=NOS
  818. #    A:INSTALL
  819. #    SET INSTOPT=
  820. #
  821. # or from a network directory:
  822. #
  823. #    SET INSTOPT=NOF NOS
  824. #    [drive:][path]INSTALL
  825. #    SET INSTOPT=
  826. #
  827. # TO DO:
  828. #
  829. #    - Possibly confirm installation abort.
  830. #    - Check for adequate free space on destination drive
  831. #      before beginning installation.
  832. #
  833. # History:
  834. #
  835. #    $Revision:   1.4  $
  836. #    $Date:   05 Jan 1993 15:31:12  $
  837. #    $Log:   D:/GM6/S/SRC/DIST/GMINST/VCS/GM60U.SCV  $
  838. #    Rev 1.4   05 Jan 1993 15:31:12   RDJ
  839. # Freeze for delivery to NLM.
  840. #
  841. # - 01/05/93 AAC RDJ
  842. #    - Did not deliver Rev 1.3 to NLM.
  843. #    - Incorporated UK's changes, accidentally omitted:
  844. #          - 12/17/92 AAC UK
  845. #          - Changed the way the WHATAMI file was being handled.
  846. #        Instead of having a single WHATAMI file, we have a batch
  847. #        file (WHATAMI.BAT) and a information file (WHATAMI.U01).
  848. #        This was done as per NLM's instructions.
  849. #
  850. #    Rev 1.3   05 Jan 1993 14:33:32   RDJ
  851. # Freeze for delivery to NLM.
  852. #
  853. # - 12/29/92 AAC RDJ
  854. #    - Add use of INSTOPT environment variable to support
  855. #      installations from a common LAN directory instead
  856. #      of from floppy disks and to circumvent the disk
  857. #      free space test.  (See comments above.)
  858. #    - Add SPACEREQ variable and check that sufficient free
  859. #      space exists on the target disk before attempting
  860. #      the installation.
  861. #
  862. #    Rev 1.2   10 Dec 1992 04:20:20   RDJ
  863. # Freeze for 2nd delivery to NLM.
  864. #
  865. # - 12/09/92 AAC RDJ
  866. #    - Received new MeSH files from NLM on 12/07/92.
  867. #    - Changed volume labels to "1 OF 4", "2 OF 4", etc.
  868. #      to conform with NLM prompt change request.
  869. #    - Changed FREPLACE so it doesn't balk if the old file
  870. #      does not exist.
  871. #    - Changed COND_DEL_O so it checks properly that the
  872. #      file does not exist.    (Thus, it doesn't ignore
  873. #      other kinds of errors.)
  874. #    - Add INSTALLATION message when installing or not
  875. #      installing Expanded MeSH.
  876. #    - Ensure that Esc/Enter windows don't drop window
  877. #      if another key is pressed.
  878. #    - If Expanded MeSH is not present in the existing GM,
  879. #      SUMMARY and INSTALLATION indicate whether the feature
  880. #      is being installed or excluded.
  881. #    - Normalize user-specified GMPATH so it always contains
  882. #      a directory specification.  Changed usage of GMPATH
  883. #      consistent with this change.    Displayed dir name has
  884. #      no backslash.
  885. #    - Put "installation complete" centered on the screen in
  886. #      bright white within its own box per NLM.
  887. #    - Could NOT display "Enter SEARCH to begin." because
  888. #      DOS insists on overwriting the message with its
  889. #      prompt.  (This would need to be done in the script
  890. #      interpreter program because the script atexit procedures
  891. #      restore the video, i.e., clear the screen.)
  892. #
  893. # - 11/29/92 AAC RDJ
  894. #    - Applied changes per NLM/MMS.
  895. #    - Did NOT make disk change prompt read "1 of 4", etc.
  896. #    - Changed GM61A (volume label component) to GM60U everywhere.
  897. #    - Did NOT remove trailing blackslash from GMPATH.
  898. #
  899. # - 11/18/92 AAC RDJ
  900. #    - When user had installed GM6 without trees and responds
  901. #      "yes" to install the expanded MeSH from the update,
  902. #      the installation procedure complained that it could
  903. #      not delete TREE.IND.
  904. #    - Added new variable, "TREEIND", to record whether "TREE.IND"
  905. #      is present when the update is applied.
  906. #    - Call FREPLACE or FCOPY for "TREE.IND" and "TREE.DCT",
  907. #      depending on "TREEIND".
  908. #
  909. #    Rev 1.1   21 Oct 1992 15:44:00   RDJ
  910. # Freeze for Ugur.
  911. #
  912. # - 10/20/92 AAC RDJ
  913. #    - Rebuilt TREE.IN1/TREE.IN2 for 5.25" floppies and
  914. #      rearranged 5.25" file distribution.
  915. #    - Set modification times for newly created files to
  916. #      those on the floppy.
  917. #    - Split 5.25" copy to avoid floppy shuffling.
  918. #    - Added cleanup after aborted installation by deleting
  919. #      temporary files.
  920. #    - Added CTRL-C and critical error handlers.
  921. #
  922. #    Rev 1.0   19 Oct 1992 15:39:20   RDJ
  923. # Initial revision.
  924. #
  925. # - 10/18/92 AAC RDJ
  926. #    - Alpha test version ready.
  927. #    - Needs CTRL-C and critical error handlers.
  928. #    - Distribute this to Ugur for testing.
  929. #
  930. # [END OF FILE]
  931.